﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CubicFWNet.Data.ViewModal
{
    public class ProductTechnologyView
    {
        #region Technology
        public System.Guid Id { get; set; }

        public System.Guid TechnologyId { get; set; }

        public System.Guid OrderId { set; get; }

        public System.Guid FinanceCostId { set; get; }

        public string Number { get; set; }
        public string TechnologyNum { set; get; }
        public string OrderNum { set; get; }
        public System.Guid OrderProductId { get; set; }
        public string ProductName { get; set; }
        public string ProductNameOth { get; set; }
        public string Materials { get; set; }
        public string Data { get; set; }
        /// <summary>
        /// 生产人数
        /// </summary>
        public int WorkersNum { get; set; }
        /// <summary>
        /// 生产工时-分钟
        /// </summary>
        public decimal WorkLenth { get; set; }
        /// <summary>
        /// 检验人数
        /// </summary>
        public int CheckNum { get; set; }
        /// <summary>
        /// 检验工时-分钟
        /// </summary>
        public decimal CheckLenth { get; set; }
        /// <summary>
        /// 分配类型 1：内部生产  2：外购
        /// </summary>
        public int DistributeType { set; get; }
        public Nullable<System.Guid> CreatorID { get; set; }
        public string CreatorName { get; set; }
        public System.DateTime CreateTime { get; set; }
        /// <summary>
        /// 最早的希望交货日期
        /// </summary>
        public string SendTime { get; set; }
        /// <summary>
        /// 加工单的状态：｛-1 初始化 1 提交  2 质检通过后  3:填写后来数据完成该生产单｝
        /// </summary>
        public int Status { get; set; }
        public string Memo { get; set; }
        public System.DateTime ApplyTime { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public decimal TechnologyAmount { get; set; }
        /// <summary>
        /// 刀模数[左右]
        /// </summary>
        public decimal Ch { get; set; }
        /// <summary>
        /// 刀模数[排]
        /// </summary>
        public decimal Cv { get; set; }
        /// <summary>
        /// 跳距-mm
        /// </summary>
        public decimal Tj { get; set; }
        /// <summary>
        /// 给定用料长-m
        /// </summary>
        public decimal GiveH { get; set; }
        /// <summary>
        /// 给定用料宽-mm
        /// </summary>
        public decimal GiveW { get; set; }
        /// <summary>
        /// 车次-每小时
        /// </summary>
        public decimal CarH { get; set; }
        /// <summary>
        /// 设备
        /// </summary>
        public int EquipmentType { get; set; }
        /// <summary>
        /// 类别（比如1 . 2 . 3类）
        /// </summary>
        public int TechType { set; get; }
        /// <summary>
        /// 该工艺是否禁用（0：启用  -1：禁用）
        /// </summary>
        public int UseStatus { set; get; }
        /// <summary>
        /// 备料说明
        /// </summary>
        public string HelpMemo { get; set; }
        /// <summary>
        /// 备料总额
        /// </summary>
        public decimal HelpMoney { get; set; }

        [NotMapped]
        public string UserName { set; get; }
        #endregion

        #region Product
        public System.Guid ProductId { get; set; }
        [DisplayName("产品名称")]
        public string Name { get; set; }
        [DisplayName("产品编号")]
        public string ProductNumber { get; set; }
        //public int Type { get; set; }
        [DisplayName("产品价格")]
        public decimal Price { get; set; }
        public string Format { get; set; }
        public string SizeWidth { get; set; }
        public string SizeLenth { get; set; }
        public string Pack { get; set; }
        public string ProductData { get; set; }
        public Nullable<System.Guid> CreatorId { get; set; }
        [DisplayName("创建者")]
        public string ProductCreatorName { get; set; }
        [DisplayName("创建时间")]
        public System.DateTime ProductCreateTime { get; set; }
        public string ProductMemo { get; set; }
        public string Image1 { get; set; }
        public string Image2 { get; set; }
        public Nullable<bool> ProductStatus { get; set; }

        public string Unit { set; get; }
        #endregion

        public Nullable<System.Guid> ParentId { set; get; }
        public decimal TotalPrice { set; get; }
        public decimal OrderFinalPrice { set; get; }
        public string OrderCustomeName { set; get; }
        public int OrderStatus { set; get; }

        public string StrOrderStatus
        {
            get
            {
                if (OrderStatus == 1)
                {
                    return "提交申请";
                }
                if (OrderStatus == 2)
                {
                    return "工艺审核";
                }
                if (OrderStatus == 3)
                {
                    return "原料成本核算";
                }
                if (OrderStatus == 4)
                {
                    return "价格核算";
                }
                if (OrderStatus == 5)
                {
                    return "价格核算";
                }
                return "";
            }
        }

        public int TechnologyStatus { set; get; }

        public int OriginalCostStatus { set; get; }

        public int FinanceCostsStatus { set; get; }

        public int WorksheetStatus { set; get; }

        public Guid WorksheetId { set; get; }
        /// <summary>
        /// 购买数量
        /// </summary>
        public decimal Amount { set; get; }
        /// <summary>
        /// 供应商
        /// </summary>
        public string CustomerName { set; get; }
        public Guid PurchaseId { set; get; }
        public Guid PurchaseComposeId { set; get; }
        /// <summary>
        /// 加工方式     1:模切      2:切卷
        /// </summary>
        public int WorkType { get; set; }
        public decimal PurchaseArrivalAmount { set; get; }
        /// <summary>
        ///1:填写采购单（等待分类） 2：等待审核 3：（同意）采购中 4：不同意 5：采购完成 6：等待已合并--等待采购  8：单独采购
        /// </summary>
        public int PurchaseStatus { set; get; }
        /// <summary>
        ///采购类型 1.订单产品外购 2.自定义采购
        /// </summary>
        public int PurchaseType { set; get; }


        /// <summary>
        /// 检验id
        /// </summary>
        public Guid ExamineId { set; get; }
        /// <summary>
        /// 检验分类 采购检验或生产检验(1:采购：2检验)
        /// </summary>
        public int ExamineType { set; get; }
        /// <summary>
        /// 申请人
        /// </summary>
        public string ApplyName { set; get; }
        /// <summary>
        /// 合格数量
        /// </summary>
        public decimal StandardAmount { set; get; }

        /// <summary>
        /// 原材料Id
        /// </summary>
        public System.Guid MaterialId { get; set; }

        public decimal Count { set; get; }
        /// <summary>
        /// 发票号
        /// </summary>
        public string FinanceNumber { set; get; }
        public Nullable<System.DateTime> ECreateTime { get; set; }

        /// <summary>
        /// 库存量
        /// </summary>
        public decimal StorageAmount { set; get; }
    }

    public class TechnologyManageView
    {
        public System.Guid Id { get; set; }
        /// <summary>
        /// 产品Id
        /// </summary>
        public System.Guid ProductId { get; set; }
        public string ProductName { get; set; }
        public string ProductNumber { get; set; }
        public int ProductStatus { get; set; }
        //public int ProductType { get; set; }
        public decimal ProductPrice { get; set; }
        public string PCreatorName { get; set; }

        /// <summary>
        /// 公差
        /// </summary>
        public decimal Tolerance { get; set; }
        /// <summary>
        /// 左右间距-mm
        /// </summary>
        public decimal Space { get; set; }
        /// <summary>
        /// 左右边距-mm
        /// </summary>
        public decimal Margin { get; set; }
        /// <summary>
        /// 跳距-mm
        /// </summary>
        public decimal Distance { get; set; }


        public System.DateTime PCreateTime { get; set; }
        /// <summary>
        /// 原材料Id
        /// </summary>
        public System.Guid MaterialId { get; set; }
        public System.DateTime CreateTime { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public decimal Amount { get; set; }
        /// <summary>
        /// 刀模数[左右]
        /// </summary>
        public decimal Ch { get; set; }
        /// <summary>
        /// 刀模数[排]
        /// </summary>
        public decimal Cv { get; set; }
        /// <summary>
        /// 跳距-mm
        /// </summary>
        public decimal Tj { get; set; }
        /// <summary>
        /// 给定用料长-m
        /// </summary>
        public decimal GiveH { get; set; }
        /// <summary>
        /// 给定用料宽-mm
        /// </summary>
        public decimal GiveW { get; set; }
        /// <summary>
        /// 车次-每小时
        /// </summary>
        public decimal CarH { get; set; }
        /// <summary>
        /// 设备
        /// </summary>
        public string Equipment { get; set; }
        public string Memo { get; set; }

        /// <summary>
        /// 设备
        /// </summary>
        public Guid EquipmentType { get; set; }
        /// <summary>
        /// 类别（比如1 . 2 . 3类）
        /// </summary>
        public int TechType { set; get; }
        /// <summary>
        /// 该工艺是否禁用（0：启用  -1：禁用）
        /// </summary>
        public int UseStatus { set; get; }
        public string Data { set; get; }

        public string MaterialIdsData { set; get; }
    }

    public class MaterialsList
    {
        public string Name { set; get; }

        public decimal Price { set; get; }

        public string Id { set; get; }
    }

    public class OrderView
    {
        public System.Guid Id { get; set; }
        public string Number { get; set; }
        public Nullable<System.Guid> CustomeId { get; set; }
        public int Status { get; set; }
        public int Stage { get; set; }
        public decimal InitPrice { get; set; }
        public decimal FinalPrice { get; set; }
        public Nullable<System.Guid> UserId { get; set; }
        public Nullable<System.Guid> CreatorId { get; set; }
        public string CreatorName { get; set; }
        public System.DateTime CreateTime { get; set; }
        public string Delivery { get; set; }
        public string Channel { get; set; }
        public string Memo { get; set; }
        public Guid SupplierId { get; set; }
        public string SupplierName { get; set; }
    }

    public class NewProductView
    {
        public System.Guid ProductId { get; set; }
        public string ProductName { get; set; }
        public string ProductSizeWidth { get; set; }
        public string ProductSizeLenth { get; set; }
        public string ProductFormat { get; set; }
        public string ProductUnit { get; set; }
        public decimal ProductAmount { get; set; }
        public decimal ProductPrice { get; set; }
        public decimal TotalMoney { get; set; }
        public decimal CostPrice { get; set; }

        public string Memo { get; set; }
    }

    public class JasonData
    {
        public string des { set; get; }

        public string name { set; get; }

        public string value { set; get; }
    }

    public class JsonDeliveryProducts
    {
        public Guid ProductId { set; get; }
        public string ProductName { set; get; }
        public decimal ProductSizeWidth { set; get; }
        public decimal ProductSizeLenth { set; get; }
        public string ProductFormat { set; get; }
        public string ProductUnit { set; get; }
        public decimal ProductAmount { set; get; }
        public decimal ProductPrice { set; get; }
        public decimal TotalMoney { set; get; }
        public decimal ProductTax { set; get; }
    }
}
